import axios from 'axios';

export const searchCmdApi = (payload, callback, callError) => {
  axios
      .post('/payload/tc/cmdsearch', payload)
      .then(response => {
        callback(response)
      })
      .catch(error => {
        callError(error)
      });
}

export const searchTcApi = (payload, callback, callError) => {
  axios
      .post('/payload/tm/tmsearch', payload)
      .then(response => {
        callback(response)
      })
      .catch(error => {
        callError(error)
      });
}

export const downloadTcApi = (data, callback, callError) => {
  axios({ 
          method: 'POST',
          url: '/payload/tm/tmexport',
          responseType: 'blob',
          data
        })
      .then(response => {
        callback(response)
      })
      .catch(error => {
        callError(error)
      });
}

